import React from 'react';

interface userProps {
  usename: string;
}
interface welcomeProps {
  style: React.CSSProperties;
  component: React.ComponentType<userProps>;
}

function Welcome(props:welcomeProps) {
  return <>
      <h1 style={props.style}>Welcome to React</h1>
      <props.component usename={"John"} />
  </>;
}
function Header(props:userProps){
  return <h1>Header{props.usename}</h1>
}
const ComponentStyle = () => {
    return (
        <div>
            <Welcome style={{color: 'blue', fontSize: '30px'}} component={Header}  />
        </div>
    );
};

export default ComponentStyle;